Image binarization converts an image of gray levels (grayscale) to a black and white image. The simplest way to use image binarization is to choose a threshold value, and classify all pixels with values above this threshold as white, and all other pixels as black. The problem then is how to select the correct threshold. In many cases, finding one threshold compatible to the entire image is very difficult, and sometimes even impossible. Therefore, adaptive image binarization is needed where an optimal threshold is chosen for each image area. When a different threshold can be used for different regions in the image, this is known as adaptive thresholding or as local or dynamic thresholding [see Pierre D. Wellner, “Adaptive Thresholding for the Digital Desk”, http://www.xrce.xerox.com/publis/cam-trs/pdf/1993/epc-1993-110.pdf.]
Image binarization is a useful process in a variety of different fields such as public safety for example.
In many public sites, such as parking lots, street intersections, highways, surveillance cameras are installed for public safety purposes or management. The installed cameras produce a huge number of images with important information. It is therefore critical to provide an effective method for precisely and rapidly retrieving this information from the images. Often, at sites where surveillance cameras take images, the luminance is usually uneven on the objects in the images making it difficult in producing a binarized image of good quality.
Optical character recognition or OCR methods, which work on a 1-bitimage, are useful in retrieving information from images. The images provided by the surveillance cameras may seem black and white to the naked eye but in fact they are in grayscale. Binarizing the images taken by the cameras to be 1-bit is a key step for OCR to precisely retrieve information from the images.
Binarizing a grayscale image converts for example an 8-bit grayscale image into a 1-bit black and white image. The key here is to determine during conversion whether a pixel on the original image should be converted to be black or white.
Converting to a Grayscale Pixel to a Black or White Pixel
In an example of a grayscale image, pixels are represented by an 8-bit set. The value of an 8-bit set is in the range [0, 255], which indicates the color depth of pixels. For a 1-bit image, its pixels are represented by 1 bit. Therefore, a pixel of a 1-bit image has only two possible color values, either 0 or 1.
To binarize a grayscale image to a corresponding binary image, we need a color value called a threshold to determine whether a pixel in the original image should be converted to a black or white pixel in its corresponding binary image. In essence we assign a color value to the pixel: 0 (white) or 1 (black). Global threshold
Using a single threshold for all pixels in a grayscale image, (e.g. global threshold), to binarize a grayscale image is the simplest way. FIG. 1 shows the result (Binarized) of binarization of a grayscale car plate image (Original) using a global threshold to assign a black or white color value to each pixel. The original image is evenly lit and as such provides a good binarized image.
Yet, in most cases and especially in sites under surveillance, photographed objects are not properly or evenly lit and thus do not provide clear images.
FIG. 2 shows the binarized result (Binarized) of a grayscale image (Original) of an unevenly lit car plate using again a global threshold. In the right-hand portion (rpo) of the original image the color of the background is almost as dark as foreground of the left-hand portion (Ipo) of the original image. Thus, the right-hand portion (rpb) of the binarized image becomes black and unrecognizable even if the background and foreground in the right-hand portion of the original image is distinguishable to the naked eye.
The above unacceptable result is due to uneven luminance on the car plate when the surveillance camera captured this image. When binarizing such an image with a global threshold, the background pixels in the right-hand portion are too dark and as such their color value is lesser than the global threshold, thus these pixels are assigned the color value 1 and the resulting background in the right-hand portion of the binarized image is converted to black.
Adaptive Thresholding
Since the use of a global threshold does not provide a binarized image of sufficient quality, using different thresholds in different parts of the image to be binarized is used to binarize an unevenly lit image. This is called adaptive thresholding and it is a commonly used method of image binarization.
As shown in FIG. 1, images with even luminance are easy to handle and the result of binarization on such images is satisfactory. The basic idea of adaptive thresholding is to divide the image to be binarized into sub-images. The sub-image should be small enough so that each one can be considered as being evenly lit. But the sub-images should also be big enough to contain sufficient information.
As shown in FIG. 3, to distinguish whether a pixel is in the background or the foreground, the value of the threshold for the sub-image A must be different from that of for the sub-image B. In this case, we need to take special care of the pixels crossing the border between two sub-images. There should be a smooth transition from one sub-image to another of the threshold value of the pixels across a border between the two sub-images. The foregoing is difficult to achieve with known techniques. One attempt of solving this problem is interpolation which is used to smoothen the threshold across the border between sub-images as described in K. Castleman, “Digital Image Processing”, Prentice-Hall Signal Processing Series, 1979. But the interpolation is just an approximation; it does not really indicate how the luminance on the object smoothly transits from a point to another.
A drawback of known methods of binarization is that they do not provide satisfactory images with sufficient detail in a timely fashion.